package com.gpt.article.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gpt.article.mapper.GptTopicContentMapper;
import com.gpt.article.domain.GptTopicContent;
import com.gpt.article.service.IGptTopicContentService;

/**
 * 大纲文章内容Service业务层处理
 * 
 * @author zhuzi
 * @date 2023-11-26
 */
@Service
public class GptTopicContentServiceImpl implements IGptTopicContentService 
{
    @Autowired
    private GptTopicContentMapper gptTopicContentMapper;

    /**
     * 查询大纲文章内容
     * 
     * @param id 大纲文章内容主键
     * @return 大纲文章内容
     */
    @Override
    public GptTopicContent selectGptTopicContentById(Long id)
    {
        return gptTopicContentMapper.selectGptTopicContentById(id);
    }

    @Override
    public GptTopicContent selectGptTopicContentByComstomId(Long comstomId)
    {
        return gptTopicContentMapper.selectGptTopicContentByComstomId(comstomId);
    }

    /**
     * 查询大纲文章内容列表
     * 
     * @param gptTopicContent 大纲文章内容
     * @return 大纲文章内容
     */
    @Override
    public List<GptTopicContent> selectGptTopicContentList(GptTopicContent gptTopicContent)
    {
        return gptTopicContentMapper.selectGptTopicContentList(gptTopicContent);
    }

    /**
     * 新增大纲文章内容
     * 
     * @param gptTopicContent 大纲文章内容
     * @return 结果
     */
    @Override
    public Long insertGptTopicContent(GptTopicContent gptTopicContent)
    {
        gptTopicContentMapper.insertGptTopicContent(gptTopicContent);
        return gptTopicContent.getFileId();
//        return gptTopicContentMapper.insertGptTopicContent(gptTopicContent);
    }

    /**
     * 修改大纲文章内容
     * 
     * @param gptTopicContent 大纲文章内容
     * @return 结果
     */
    @Override
    public int updateGptTopicContent(GptTopicContent gptTopicContent)
    {
        return gptTopicContentMapper.updateGptTopicContent(gptTopicContent);
    }

    /**
     * 批量删除大纲文章内容
     * 
     * @param ids 需要删除的大纲文章内容主键
     * @return 结果
     */
    @Override
    public int deleteGptTopicContentByIds(Long[] ids)
    {
        return gptTopicContentMapper.deleteGptTopicContentByIds(ids);
    }

    /**
     * 删除大纲文章内容信息
     * 
     * @param id 大纲文章内容主键
     * @return 结果
     */
    @Override
    public int deleteGptTopicContentById(Long id)
    {
        return gptTopicContentMapper.deleteGptTopicContentById(id);
    }
}
